package com.dragon.app.design.pattern.prototype;

import java.util.Date;

public class Sheep implements Cloneable {
	private String name;
	private Date birth;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Date getBirth() {
		return birth;
	}

	public void setBirth(Date birth) {
		this.birth = birth;
	}
	
	/**
	 * object的clone是浅拷贝
	 */
	@Override
	public Sheep clone() throws CloneNotSupportedException {
		Sheep obj = null;
		try {
			obj = (Sheep) super.clone();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return obj;
	}

	@Override
	public String toString() {
		return "Sheep [name=" + name + ", birth=" + birth + "]";
	}
	

}
